#include <stdio.h>
#include "sys.h"

int main() {
    int cnt = 0;
    pcap_t *pcap = pcap_device_open(netdev0_phy_ip, netdev0_hwaddr);
    while (pcap) {
        static uint8_t buffer[1024];
        plat_printf("begin test: %d\n", cnt++);
        for (int i = 0; i < sizeof(buffer); i++) {
            buffer[i] = i;
        }
        if (pcap_inject(pcap, buffer, sizeof(buffer)) == -1) {
            plat_printf("pcap send: send packet failed %s\n", pcap_geterr(pcap));
            break;
        }
        sys_sleep(10);
    }
    return 0;
}